package com.lening.organization.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lening.common.base.BaseService;
import com.lening.common.base.BaseServiceImpl;
import com.lening.organization.mapper.DepartmentMapper;
import com.lening.organization.dto.DepartmentDTO;
import com.lening.organization.po.Department;
import com.lening.organization.service.DepartmentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class DepartmentServiceImpl extends BaseServiceImpl<DepartmentMapper, Department, DepartmentDTO> implements DepartmentService, BaseService<Department, DepartmentDTO> {

    @Autowired
    private DepartmentMapper departmentDAO;

    @Override
    public Page<Department> findDepartment(Integer pageNum, Integer pageSize, Page<DepartmentDTO> departmentDTO) {
        Page<Department> page = departmentDAO.findDepartment(pageNum, pageSize, departmentDTO);
        return page;
    }

    @Override
    public List<Department> findByParentId(Long parentId) {
        List<Department> departmentList = departmentDAO.findByParentId(parentId);
        return null;
    }

}
